//
//  QMCycelScrollViewCell.m
//  QcMedical1
//
//  Created by 仲启明 on 2016/12/20.
//  Copyright © 2016年 jiawen Du. All rights reserved.
//

#import "QMCycelScrollViewCell.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
@interface QMCycelScrollViewCell ()<SDCycleScrollViewDelegate>

@end
@implementation QMCycelScrollViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI
{
    
    NSArray *imageArray = @[ @"http://img.guahao.com/portal_upload/rollingnews/1453447883150.jpg", @"http://img.guahao.com/portal_upload/mediafocus/1461826474435.jpg", @"http://img.guahao.com/portal_upload/rollingnews/1461574027543.jpg" ];
    
    UIImage *image = [[UIImage alloc] init];;
    
    SDCycleScrollView *cycleView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 180) delegate:self placeholderImage:image];
    
    cycleView.imageURLStringsGroup = imageArray;
    
    [self.contentView addSubview:cycleView];

}

- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
   
    NSLog(@"第%zd张图片",index);
    
}

@end
